#include<iostream>
#include<cstring>
using namespace std;
int h[200];
int main()
{
	int t;
	cin >> t;
	while (t--) {
		int n;
		cin >> n;
		memset(h, 0, sizeof(h));
		string s;
		cin >> s;
		int ans = 0;
		for (int i = 0; i < s.size(); i++) {
			char ch = s[i];
			if (!h[ch]) {
				ans += 2;
			}
			else {
				ans++;
			}
			h[ch] = 1;
		}
		cout << ans << endl;
	}
	return 0;
}